package com.link510.aitools.data;


import com.link510.aitools.core.data.CWMRetrofit;
import com.link510.aitools.core.data.restapi.CommandService;
import com.link510.aitools.core.message.MessageInfo;

import io.reactivex.Observable;

public class CommandData {


    private static CommandData mInstance = null;

    /**
     * 环境探测器服务
     */
    private CommandService commandService;

    /**
     * 单例
     *
     * @return EnvironData
     */
    public synchronized static CommandData getInstance() {

        if (mInstance == null) {
            mInstance = new CommandData();
        }

        return mInstance;
    }


    /**
     * 默认构造方法
     */
    private CommandData() {
        commandService = CWMRetrofit.instance().create(CommandService.class);
    }

    /**
     * 获取广告列表
     *
     * @param deviceSN 设备编号
     * @param command  设备命令
     * @return 返回广告列表
     */
    public Observable<MessageInfo<String>> get(String deviceSN, String command) {
        return commandService.get(deviceSN, command);
    }
}
